function single(){
	var $checkeds = $("input[type='checkbox']:checked,input[type='radio']:checked");
	if ($checkeds.length == 0) {
		$.ligerDialog.alert('未选中任何记录!');
		return false;
	}else if($checkeds.length > 1){
		$.ligerDialog.alert('请选中一条记录!');
		return false;
	}
	return true;
}

function multiple(){
	var $checkeds = $("input[type='checkbox']:checked,input[type='radio']:checked");
	if ($checkeds.length == 0) {
		$.ligerDialog.alert('未选中任何记录!');
		return false;
	}
	return true;
}

function _create(url) {
	document.forms[0].action = url;
	document.forms[0].submit();
}

function _modify(url) {
	document.forms[0].action = url;
	document.forms[0].submit();
}

function _remove(url) {
	var $checkeds = $("input[type='checkbox']:checked,input[type='radio']:checked");
	if ($checkeds.length == 0) {
		$.ligerDialog.alert('未选中任何记录!');
		return;
	}
	$.ligerDialog.warning('确定删除选中的所有记录吗?', function(action) {
		if (action == 'yes') {
			document.forms[0].action = url;
			document.forms[0].submit();
		}
	});
}

function _screen(url) {
	if (window.screener) {
		window.screener.show();
		return;
	}

	var $container = $('<div id="filter-container"></div>').width(360).height(120).hide();

	var key = $("input[name='screener-key']").val();
	var $filter = $container.ligerFilter({
		fields : screeners[key]
	});

	window.screener = $.ligerDialog.open({
		width : 560,
		height : 320,
		title : '筛选器',
		target : $container,
		isResize : true,
		top : 50,
		buttons : [ {
			text : '确定',
			onclick : function(item, dialog) {
				var object = $filter.getData();
				var condition = $.ligerui.toJSON(object);
				window.location.replace(url + (url.indexOf("?") >= 0 ? "&" : "?") + "condition" + "=" + condition);
				dialog.hide();
			}
		}, {
			text : '取消',
			onclick : function(item, dialog) {
				dialog.hide();
			}
		} ]
	});
}
